#!/bin/sh

EMUSETUP=drives/c/emusetup.bat
COMMAND=${1:-c:\\db\\db}

echo "@echo off" > $EMUSETUP

for d in drives/*; do
	[ -d "$d" ] && echo lredir $(basename $d): linux/fs$(pwd)/$d |
		sed 's|/|\\|g' >> $EMUSETUP
done

cat >> drives/c/emusetup.bat <<EOF
c:
if exist autoexec.bat call autoexec.bat
${COMMAND}
EOF

dosemu $(pwd)/drives/c/emusetup.bat

